#ifndef _STATIC_HH_
#define _STATIC_HH_

// c++
#include <chrono>
#include <thread>

#include <ostream.hh>

#define LOG_ENTER(x) LOG_COUT_BEGIN << "entering " << x << LOG_COUT_ENDL
#define LOG_EXIT(x) LOG_COUT_BEGIN << "exiting " << x << LOG_COUT_ENDL

namespace Mage {

class CtorSleep
{
public:
    CtorSleep(int sleep_time, const std::thread::id& tid)
    {
        LOG_ENTER("CtorSleep()");
        std::this_thread::sleep_for(std::chrono::seconds(sleep_time));
        _tid = tid;
        LOG_EXIT("CtorSleep()");
    }

    std::thread::id who() const
    {
        return _tid;
    }
    
private:
    std::thread::id _tid;
};

} // namespace Mage

#endif // _STATIC_HH_
